Add source-level internal function visibility#1945
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
| \n### CI Failure Hints\n\nFailed jobs: `checks`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7f69bda. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Extends the open Midnight source-fidelity PR beyond
internalfunction visibility and removes the need for downstream Yul patching for the next Morpho Midnight blockers.This now covers:
internalfunction modifiers, excluded from selector dispatch and ABI JSON;MappingStruct/MappingStruct2members by expanding them into stable word-addressed struct members such asroots[1]andproof[1][1];Compiler.Modules.Create2SSTORE2;Dynamic calldata struct and array ABI support already existed in Verity through the dynamic ABI head/element machinery, so this PR does not duplicate that feature; it adds smoke coverage around the remaining source-level gaps instead.
Verification
lake build Verity.Macro.Translatelake build Contracts.InternalVisibilitySmoke Contracts.Smoke Compiler.CompilationModelFeatureTestpython3 scripts/check_macro_property_test_generation.pypython3 scripts/check_trust_surface_registry.pymake checkNotes
The CREATE2/SSTORE2 helpers intentionally keep protocol-specific obligations in the ECM trust surface: callers still own initcode layout, CREATE2 address derivation, and pointer bytecode layout proofs or assumptions. The compiler surface now emits the needed low-level mechanics directly, so downstream projects should not rewrite generated Midnight Yul for these operations.
Note
Medium Risk
Touches EVM deployment and external-code copy mechanics with explicit trust assumptions; macro storage layout expansion affects mapping struct addressing across generated Yul.
Overview
Adds CREATE2 deployment and SSTORE2-style code reads as first-class ECMs (
create2Deploy,sstore2ReadCode) that lower tocreate2andextcodecopy, with trust-report assumptions for initcode layout, address derivation, and pointer bytecode layout.Extends the compilation model and trust surface with
codecopy,extcodecopy, andcreate2as typed low-level mechanics (including intrinsic expression collection and--deny-low-level-mechanics/ unsafe-boundary / linear-memory classification).MappingStruct / MappingStruct2 members can now use fixed arrays: macro elaboration expands them into stable indexed member names (e.g.
roots[1],proof[1][1]) with computed word offsets, plus smoke coverage and generated property tests.Adds callback ABI and CREATE2/SSTORE2 smoke contracts with Yul and trust-report regression tests; documents architecture/contributor checklists and updates capabilities/docs for the new trust boundaries.
Reviewed by Cursor Bugbot for commit 7f69bda. Bugbot is set up for automated code reviews on this repo. Configure here.